class Admin::CatalogsController < ApplicationController
  
  def index
    list
    
    render :action => "list"
  end

  def show
  end

  def new
    @catalog = Catalog.new
    @catalogs = Catalog.find(:all, :order => 'name')
  end
  
  def list
    @catalogs = Catalog.paginate :page => params[:page]
  end
  
  def create
    @catalog = Catalog.new(params[:catalog])
    
    if @catalog.save
      flash[:notice] = "Successfully created..."
      
      redirect_to :action => "index"
    else
      @catalogs = Catalog.find(:all, :order => 'name')
      render :action => "new"
    end
  end
end
